package tripModel;

import java.util.List;

import com.jfinal.plugin.activerecord.Model;

public class Note extends Model<Note> {
	/**
		 * 
		 */
	private static final long serialVersionUID = 1L;
	public static final Note dao = new Note();

	/*
	 * 景点各游记首张图片
	 */
	public Nimg findNimgsByTop() {
		return Nimg.dao.findFirst("select niimgPath from nimg where niNID=? limit 1", getLong("nID"));
	}

	/*
	 * 景点各游记作者信息
	 */
	public User findUser() {
		return User.dao.findByIdLoadColumns(getLong("nUID"), "uID,uName,uImgPath");
	}

	/*
	 * 获得景点游记所有图片
	 */
	public List<Nimg> findNimgsByNid() {
		return Nimg.dao.find("select niimgPath from nimg where niNID=?", getLong("nID"));
	}
}
